UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wyy+Ct6/gs+ApUXjays8cZQY2U+lYbzoegfwmTbla4c=' 
WHERE 
  key_id = '41c20fd9a8ad1e91b357221587ad7da48cac84ff1c6e924ffbfaadac0d7cbdbb' 
  AND (
    token = 'wyy+Ct6/gs+ApUXjays8cZQY2U+lYbzoegfwmTbla4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043