UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cHJLfH2z/PvuT4tOR61G9Dtl1aJ19lGiXp5oc0oHpGw=' 
WHERE 
  key_id = '2b1e2a6791427450d227367d207b61a501709f9aac21fb41056a390ad09eb896' 
  AND (
    token = 'cHJLfH2z/PvuT4tOR61G9Dtl1aJ19lGiXp5oc0oHpGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023