UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+M+qCi94N3ee2hPyQ5MAOVJMgsNkguiFnlzK1omsAk4=' 
WHERE 
  key_id = '660d28001c0bcf978f2b4f3194896afc6b71d05b9bd465d70a896f2fc0ea3b2c' 
  AND (
    token = '+M+qCi94N3ee2hPyQ5MAOVJMgsNkguiFnlzK1omsAk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044