UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ek/06pWwUhP5/tEFFAgkHs4xzRPoH9A7o70Rc8Zd+wk=' 
WHERE 
  key_id = 'fca9b94fbe25ff11472f55881395e2893f04a6e69fba24ba34f729231d499c28' 
  AND (
    token = 'ek/06pWwUhP5/tEFFAgkHs4xzRPoH9A7o70Rc8Zd+wk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042