UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '55cgbcsVcCQIipiI0YViVum1wPPliJ+3jYCJcXWgwEM=' 
WHERE 
  key_id = '70d6526a7fa03d2ff360d4cc4d17d61ed1e60e7ea84ab37c75f3c0525b046977' 
  AND (
    token = '55cgbcsVcCQIipiI0YViVum1wPPliJ+3jYCJcXWgwEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030