UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'umI19pDByGK7LQrY3s9T7q8gmW72/pP302bHYIg7hwI=' 
WHERE 
  key_id = '11e5382becee3a5a19bfbe0dbc7aa3cb307fe974c3eb67b8ee30b1e84b512cce' 
  AND (
    token = 'umI19pDByGK7LQrY3s9T7q8gmW72/pP302bHYIg7hwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036