UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mBLeOoaJAgvDH+WGR1iSL8u7smznYm02U3KtTBPWA3o=' 
WHERE 
  key_id = '74e4bcac88562d3ddd92af4f6d955d7db94934208b5ac54eb81e884645e7f7ef' 
  AND (
    token = 'mBLeOoaJAgvDH+WGR1iSL8u7smznYm02U3KtTBPWA3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015