UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ube3fqkTC/HDgLv5qGzAl9PVAEEA5LNDmSQnxRCXBIs=' 
WHERE 
  key_id = '45196ba3c3eb742223fa1442c51391d292d6e634051edc6b54691e20766af36a' 
  AND (
    token = 'Ube3fqkTC/HDgLv5qGzAl9PVAEEA5LNDmSQnxRCXBIs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025