UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L53VdETWdryqjk54V/3X+thtljOeqIpPGxlxs6QrLQA=' 
WHERE 
  key_id = '748bca337a8b87b1f3ceeac063db3b0877f8a0d85dea9822d665814ff0f24e43' 
  AND (
    token = 'L53VdETWdryqjk54V/3X+thtljOeqIpPGxlxs6QrLQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032