UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I2B55xgqTQdIJGe3o5qcvtsqzJpTpQ6JqBhXeGmD93E=' 
WHERE 
  key_id = 'a932e20495e7776fd0d911c6e236d5215a85146d5eca6a1b489fa1af809b4802' 
  AND (
    token = 'I2B55xgqTQdIJGe3o5qcvtsqzJpTpQ6JqBhXeGmD93E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030