UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZBi//HkmrXNXocf6oWOxys2MK+y2g38yrDaxST5pFE=' 
WHERE 
  key_id = '33d41a382b33ab987ad2837348f999581ea26a555796c0fa4233fc9514f86693' 
  AND (
    token = 'lZBi//HkmrXNXocf6oWOxys2MK+y2g38yrDaxST5pFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023