UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RYkuZHYIUQPCIjfueS2u/k/7SPBPOyJsqINSvuMylVM=' 
WHERE 
  key_id = '0853cc4da77a55b410f85e257a91242909c9281059a9c699a762fbd7d08e0eab' 
  AND (
    token = 'RYkuZHYIUQPCIjfueS2u/k/7SPBPOyJsqINSvuMylVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034