UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1MBqFR6TnvPxMA5IuQLvN75A9FY9eg3AfGMCfHnzSRs=' 
WHERE 
  key_id = '6eefbe0a7f8672315770e4e2f12bd98e7ff2ffab096bf95b56d5081a8e772c1d' 
  AND (
    token = '1MBqFR6TnvPxMA5IuQLvN75A9FY9eg3AfGMCfHnzSRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048