UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lPTeqjDEI9eqkao14Xo00v6KNj2bpLD7n/pd7nlhpoE=' 
WHERE 
  key_id = '7d085ed4f2c0f064d1d69086988abe1b434ecb3144dbb2706f7c0136c714952d' 
  AND (
    token = 'lPTeqjDEI9eqkao14Xo00v6KNj2bpLD7n/pd7nlhpoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030