UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Xs1ysSzh/5V47ue/MLN3cgDH2GWBZHPm5tknAa6B9E=' 
WHERE 
  key_id = 'a4d3e58bcc41e2ec143297806ed32a5c649d061ff01a4b29270d867987f51aff' 
  AND (
    token = '9Xs1ysSzh/5V47ue/MLN3cgDH2GWBZHPm5tknAa6B9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041