UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mLE4wbckyCmR5eQxBrlvQuSqqmMfCvzPM+AsCWeA2BY=' 
WHERE 
  key_id = 'fc0304e08328c451fa80f3932cfde4de50ce2ab3ca04d21f60878ca5aa8f600d' 
  AND (
    token = 'mLE4wbckyCmR5eQxBrlvQuSqqmMfCvzPM+AsCWeA2BY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024