UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4s8sJMyT6uIs8zCeOhtvH4Iup21hNs1F1XQJ5bTLv4s=' 
WHERE 
  key_id = 'd677a80c2cded6fb3faf6504648904a71e6608816b45fb0158176ab577e83d16' 
  AND (
    token = '4s8sJMyT6uIs8zCeOhtvH4Iup21hNs1F1XQJ5bTLv4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017