UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IpkUQ+Z6bfDg1AFectwtxdmLaa60jSZzyS21XgU7wfo=' 
WHERE 
  key_id = '9c1b0f300b8d5434724d7488ba738c4aaff8eed8a5c6aa1479a984f414aa4332' 
  AND (
    token = 'IpkUQ+Z6bfDg1AFectwtxdmLaa60jSZzyS21XgU7wfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036