UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1baZADQKO05qDz7PR+9z9TARDebo2WSvaWfLsm6NI+s=' 
WHERE 
  key_id = '8e6ad8c732a00ea67c00cf5e86da205c0c061adcbc7875ffdb79887e685f7199' 
  AND (
    token = '1baZADQKO05qDz7PR+9z9TARDebo2WSvaWfLsm6NI+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033