UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BkJVqXlYQHuKw8JnoDQNRrllUdvtxXxvWbqep7mg6S4=' 
WHERE 
  key_id = '0651d59c0c2569ab2f3feb72b9cb0fa7c22a50b13bab0658b956cbdd650b184e' 
  AND (
    token = 'BkJVqXlYQHuKw8JnoDQNRrllUdvtxXxvWbqep7mg6S4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025