UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aioPqeelFjlo13uIDGXVd/6OKbNL7hdtGGdYwIFMq2k=' 
WHERE 
  key_id = '0e7f055226561ec7acb49fcda2625b98fe4c7ede2391c7dda0fd324656067956' 
  AND (
    token = 'aioPqeelFjlo13uIDGXVd/6OKbNL7hdtGGdYwIFMq2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036