UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rIyqfoqkleNQWO/Ua8h0MGnNdsW88tjrJEuXDJnpqvo=' 
WHERE 
  key_id = 'aa1cdb2d4c6560dfc456d1203d9f8fbb00e884e08885a1a4ab24097634d20710' 
  AND (
    token = 'rIyqfoqkleNQWO/Ua8h0MGnNdsW88tjrJEuXDJnpqvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035