UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SxozY7+UhgDXBXHbSPhfNnV5WE45YKTthwNA2ZvaJgY=' 
WHERE 
  key_id = '32d6565800ac00c3871691a0b33492957335dd79b9c815523d67fd621d0b4f1c' 
  AND (
    token = 'SxozY7+UhgDXBXHbSPhfNnV5WE45YKTthwNA2ZvaJgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020