UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LyXlcnUWXP+8UWY2RQJ/MeEYastOwvHKfDILfLpK6p8=' 
WHERE 
  key_id = 'fd9a2eb4b7b1f1c17ccd1e5c995ee10e50a19ade2d962207d63e863b66ea2dab' 
  AND (
    token = 'LyXlcnUWXP+8UWY2RQJ/MeEYastOwvHKfDILfLpK6p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033