UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bpAXOtrBPi257Ft0KfY1GX3j/fwiP6+OUk3xNWeXCVk=' 
WHERE 
  key_id = '1b818aa753a86a55a0229f539e345c674ed07ecdee73f7228b7ad8e413997546' 
  AND (
    token = 'bpAXOtrBPi257Ft0KfY1GX3j/fwiP6+OUk3xNWeXCVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019