UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2BOwOr2tSOz5190TTqIvT2yN4/myxh+aHxJ/8leByNs=' 
WHERE 
  key_id = '70c7fd89bddf6e49929a74cec52d709c5e22ed87750eb874096d51ce02974ba3' 
  AND (
    token = '2BOwOr2tSOz5190TTqIvT2yN4/myxh+aHxJ/8leByNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030