UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JURdCH1XGK6B6eH9n6rvPmS+izAE8WSq/1lv8+ewx8E=' 
WHERE 
  key_id = 'ae752280122edc14a0b766a53d6635e8d9d2c3ad468c25fac54d36c1162b2ea7' 
  AND (
    token = 'JURdCH1XGK6B6eH9n6rvPmS+izAE8WSq/1lv8+ewx8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027