UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1MYIJYvoQSCYoh0VVoOsBoqz5EIgRmFPQcT7pjiyoVM=' 
WHERE 
  key_id = '85069b2c0faab295213295073f5b6263767b9401e9084dd70701f3b6a1d622a8' 
  AND (
    token = '1MYIJYvoQSCYoh0VVoOsBoqz5EIgRmFPQcT7pjiyoVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024