UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8hs7cgjzybpFCnEi7TZ73vgE+o5Y1J8E83s7YRdtLZc=' 
WHERE 
  key_id = 'a35409f3db73193b5c9317e42670063dd2f0fec2279b96f00ed23ca541c3f58b' 
  AND (
    token = '8hs7cgjzybpFCnEi7TZ73vgE+o5Y1J8E83s7YRdtLZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029