UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BZT7NcSVyuPOCEIBwkpnlH8X0T9kN2Hh8b0N4CBhwjQ=' 
WHERE 
  key_id = 'e7920e0ccd3167496587a2cb4c0995ac19277f3842911abbf74e215dcb3fd2a3' 
  AND (
    token = 'BZT7NcSVyuPOCEIBwkpnlH8X0T9kN2Hh8b0N4CBhwjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026