UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QMrDw9osnUFviNbGUgeDQnUL5m0LBDWQVfX/Niob5dw=' 
WHERE 
  key_id = '99b152a207bfa7585cbbd42336a5761f268be3e443b001f521c06285668264f5' 
  AND (
    token = 'QMrDw9osnUFviNbGUgeDQnUL5m0LBDWQVfX/Niob5dw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022