UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2OKzW4FtlYvenAPtj2FItM8G6VToNYPmbvsGJTYhd2Q=' 
WHERE 
  key_id = 'a37c53108731056b2ca35fcf1bc9af2e3beaa408927a46340790ff9851b3900e' 
  AND (
    token = '2OKzW4FtlYvenAPtj2FItM8G6VToNYPmbvsGJTYhd2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032