UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/ysUDeTBMGFthVJJ0z8e5SpxOrPAJMXhIxFbQFNdLU=' 
WHERE 
  key_id = '0745799fb7c2da2ce0e37dd2069bf0ecd11bd448cfdb3cd2628d5056c5eca0d5' 
  AND (
    token = 'l/ysUDeTBMGFthVJJ0z8e5SpxOrPAJMXhIxFbQFNdLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00498