UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UKQIommmWLX2++6Tzhh6FTRcqZQA8w+rIF6iIWEx10k=' 
WHERE 
  key_id = '8872ecde6259cf2c43d38f7472d30c90fef2b512b0e7f4726ffe17b44ed79654' 
  AND (
    token = 'UKQIommmWLX2++6Tzhh6FTRcqZQA8w+rIF6iIWEx10k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038