UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BSsnIv8EUrsoxNoi5ykk5jrgvf9Gy2yAf8B8xXvAUB0=' 
WHERE 
  key_id = '6756ac3d5227b9c169be546484c9eb56defb4ce53ac47c0c5767d3b814408c8f' 
  AND (
    token = 'BSsnIv8EUrsoxNoi5ykk5jrgvf9Gy2yAf8B8xXvAUB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074