UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jITF4WpSYxOYFQbO0Yi3zbrMDCXLodwknHUthO4E154=' 
WHERE 
  key_id = 'ab52c9bcac6e6122b054ddbc0928b709137d5a156d2ecac15b83ba8d07b900d1' 
  AND (
    token = 'jITF4WpSYxOYFQbO0Yi3zbrMDCXLodwknHUthO4E154=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044