UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vIEX5RInFgo31fnPjR0Fc4A/DFVTTVHxIXpbMo0YVhw=' 
WHERE 
  key_id = 'b5957ce240dff2ea72ca6734607472bf7baaaaa3697d4b5295c774949b6dc4a6' 
  AND (
    token = 'vIEX5RInFgo31fnPjR0Fc4A/DFVTTVHxIXpbMo0YVhw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037